using UnityEngine;

public class WheelRotator : MonoBehaviour
{
	public Transform fl_wheel;

	public Transform fr_wheel;

	public Transform rl_wheel;

	public Transform rr_wheel;

	private void Update()
	{
		rotateWheels(30f);
	}

	private void rotateWheels(float speed)
	{
		float xAngle = Mathf.Abs(speed) * Time.deltaTime / 1.5f * 57.29578f;
		if (fl_wheel != null)
		{
			fl_wheel.Rotate(xAngle, 0f, 0f);
		}
		if (fr_wheel != null)
		{
			fr_wheel.Rotate(xAngle, 0f, 0f);
		}
		if (rl_wheel != null)
		{
			rl_wheel.Rotate(xAngle, 0f, 0f);
		}
		if (rr_wheel != null)
		{
			rr_wheel.Rotate(xAngle, 0f, 0f);
		}
	}
}
